<?php

/**
 * contact : 刘经理 19326416371
 * company : 版权所属 四川北星惯牌科技有限公司
 **/

namespace app\api\validate;

use app\common\library\Sms;
use app\common\model\CaptainApplication;
use think\Validate;

class CaptainTeam extends Validate
{
    protected $name;

    protected $idcard;

    /**
     * 验证规则
     */
    protected $rule = [
        'title' => 'require|max:150',
        'start_date'   => 'require|date',
        'end_date'   => 'require|date',
        'max_people'   => 'require|number|between:1,100',
        'min_people'   => 'require|number|between:1,100',
        'rule'   => 'require',
        'describe'   => 'require',
        'address'   => 'require',
        'release'   => 'require|in:1,0',
        'long'   => 'require',
        'lat'   => 'require',
    ];

    /**
     * 字段描述
     */
    protected $field = [
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'title.require'=>'标题不能为空',
        'start_date.require'=>'开始时间不能为空',
        'end_date.require'=>'结束时间不能为空',
        'max_people.require'=>'最大人数不能为空',
        'max_people.number'=>'最大人数请输入整数',
        'max_people.between'=>'最大人数区间为1-100',
        'min_people.require'=>'最小人数不能为空',
        'min_people.number'=>'最小人数请输入整数',
        'min_people.between'=>'最小人数区间为1-100',
        'rule.require'=>'组队规则不能为空',
        'describe.require'=>'组队描述不能为空',
        'address.require'=>'组队地址不能为空',
        'release.in'=>'请选择是否发布',
        'long.require'=>'经度不能为空',
        'lat.require'=>'纬度不能为空',
    ];
    public function __construct(array $rules = [], $message = [], $field = [])
    {
        parent::__construct($rules, $message, $field);
    }

    protected function setFiled($key,$value)
    {
        $this->$key = $value;
    }

    public function getFiled($key)
    {
        return $this->$key;
    }
}
